
using System;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace EnterpriseServices.Service
{
    /// <summary>
    /// 
    /// </summary>
    [ServiceContract(Name="UserService")]
    public interface IUserManager
    {
        /// <summary>
        /// Authenticates the user.
        /// </summary>
        /// <param name="applicationName">Name of the application.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        bool Authenticate(string applicationName, string userName, string password);

        /// <summary>
        /// Verifies user role's membership.
        /// </summary>
        /// <param name="applicationName">Name of the application.</param>
        /// <param name="userName">Name of the user.</param>
        /// <param name="role">The role.</param>
        /// <returns>
        /// 	<c>true</c> if [is in role] [the specified application name]; otherwise, <c>false</c>.
        /// </returns>
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        bool IsInRole(string applicationName, string userName, string role);

        /// <summary>
        /// Returns all roleList the user is a member of.
        /// </summary>
        /// <param name="applicationName">Name of the application.</param>
        /// <param name="userName">Name of the user.</param>
        /// <returns></returns>
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        string[] GetRoles(string applicationName, string userName);
    }
}